﻿<%@ Page Language="C#" MasterPageFile="~/SimplePMT.Master" AutoEventWireup="true" CodeBehind="ReportIteration.aspx.cs" Inherits="SimplePMT.ReportIteration" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="MainContent">
    <form name="testForm">
    <p>
    From: <%= CalendarInput.Calendar("StartDate", Convert.ToDateTime(StartDate)) %>&nbsp;&nbsp;&nbsp;To:<%= CalendarInput.Calendar("EndDate", Convert.ToDateTime(EndDate))%>&nbsp;&nbsp;<input type="button" value="Get Report" OnClick="loadStatus();"/>
    </p>
    <div id="reportContents">
    <%= onLoadReport%>
    </div>
    </form>
    <script>
        function loadStatus() {
            var df = document.testForm;
            SimplePMT.ReportIteration.LoadReport(df.StartDate.value, df.EndDate.value, function(response) {
                if (response.error != null) {
                    alert(response.error.Message);
                }
                document.getElementById('reportContents').innerHTML = response.value;
            });
            
        }
       
    </script>
</asp:Content>